Imports CrystalDecisions.CrystalReports.Engine

Public Class FrmCrKhachHang
    Private customerReport As ReportDocument
    Private reportPath, sqlQuery As String
    Private flagIn As Integer = 0

    Private Sub FrmCrKhachHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        sqlQuery = " SELECT * FROM tbl_khachhang WHERE ma_nhom <> 'KT' ORDER BY ten_nhacungcap "
        If flagIn = 0 Then
            reportPath = Application.StartupPath & "\" & "CrKhachHang.rpt"
        Else
            reportPath = Application.StartupPath & "\" & "CrKhachHang_HosoGDP.rpt"
        End If

        'Dim reportPath = Application.StartupPath & "\" & "CrKhachHang.rpt"
        'Dim reportPath = Application.StartupPath & "\" & "CrKhachHang_HosoGDP.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        Me.CrQuanview.ReportSource = customerReport
    End Sub
    Public Sub setInBaocao(ByVal s As Integer)
        flagIn = s
    End Sub

End Class
